feat: run integration tests in CI#93
Open
jansdhillon wants to merge 17 commits intocanonical:mainfrom
Open
Conversation
…flow The canonical/operator-workflows integration test calls tox -e integration, but this repo uses uv run pytest directly (no tox config). It also includes k8s/kubectl cleanup steps not needed for the lxd provider. Replace with a standalone workflow that: - Uses charmed-kubernetes/actions-operator for LXD + Juju setup - Builds the charm with charmcraft - Runs tests with uv run pytest directly Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
charmcraft pack --platform requires a matching LXD build environment and the right tooling (charmcraftlocal, etc.) — that's all handled by build.yaml already. Call build.yaml as a dependency and download the packed artifact. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
No --model flag, no manual juju add-model. The conftest uses jubilant.temp_model() which handles model lifecycle automatically. Command matches exactly what CONTRIBUTING.md documents. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When juju deploys a bundle, it copies the bundle file into its own snap temp directory. Relative paths in the bundle are then resolved from there instead of the original bundle location, causing lookups to fail. Rewrite local charm paths to absolute before handing the bundle to jubilant so they remain valid regardless of where juju copies the file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The name_in_artifact field from data-platform-workflows only replaces ':' with '-', preserving '@'. So the artifact is named packed-charm-.--platform-ubuntu@24.04-amd64, not ubuntu-24.04-amd64. Also use needs.build.outputs.artifact-prefix for correctness. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…osted Self-hosted runner was arm64, causing haproxy constraint failures. This is a public repo so ubuntu-latest is fine. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the temp-file/absolute-path rewriting hack — unnecessary now that the charm artifact lands at the workspace root and the bundle's relative path resolves correctly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Juju copies the bundle YAML into its snap temp directory before parsing. Relative charm paths are then resolved from that temp location rather than the bundle's original directory, causing deploy failures. Writing a temp bundle with absolute paths avoids this. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…atform name The artifact is named with ubuntu@24.04 (@ not -), so the pattern must match that exactly. Using the build job's artifact-prefix output ensures the prefix also matches correctly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ate lbaas model Previously the lbaas fixture ran before bundle was deployed (no dependency chain), found landscape-server absent in the empty temp model, and skipped all lbaas-dependent tests immediately. - Add bundle as a fixture dependency so the bundle is deployed first - Yield None when no separate LBaaS model is configured; tests that genuinely need cross-model haproxy skip themselves via their existing 'lbaas is None' guards - Tests that only need the co-deployed haproxy use _haproxy_ip() which already checks the local model first - Remove unused auto-create-lbaas-model code path (only triggered via 'make lbaas' with explicit env vars anyway) - Remove unused has_haproxy_route_provider import and uuid import Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…idation failure redirect_https=none generates a HAProxy rule that exceeds the 64-word line limit, causing HAProxy to stay in 'waiting' state and the all_active wait to time out. Use 'default' instead, which is the sane baseline for CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enable IPv4 forwarding and NAT masquerade so LXD containers can reach the Ubuntu archive and Launchpad PPAs during charm install hooks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on: https://github.com/canonical/haproxy-operator/blob/main/.github/workflows/integration_test.yaml